package com.label.grade.controller;/**
 * @author zhf
 * @date 2023/7/9 17:41
 * @version 1.0
 */

import com.label.Config.Logger.LogAnnotation;
import com.label.Model.Common.ResponseBean;
import com.label.grade.service.AcademicAlertService;
import org.apache.commons.httpclient.HttpStatus;
import org.apache.ibatis.annotations.Param;
import org.apache.shiro.authz.annotation.RequiresAuthentication;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author zhf
 * 项目：student
 * 描述：学业预警
 * @date 2023/7/9 17:41
 **/

@RestController
@CrossOrigin
@RequestMapping("/learninganalysis/academicalert")
public class AcademicAlertController {

    @Resource
    private AcademicAlertService academicAlertService;

    @GetMapping("/getall")
    @LogAnnotation(module = "学业预警模块", operator = "获取所有学生的学业预警")
    @RequiresAuthentication
    public ResponseBean getAll(@Param("teacherCode") String teacherCode){
        return new ResponseBean(HttpStatus.SC_OK,"成功返回学业预警信息",academicAlertService.getAcademicAlertAll(teacherCode));
    }

    @GetMapping("/getone")
    @LogAnnotation(module = "学业预警模块", operator = "获取某个学生的学业预警")
    @RequiresAuthentication
    public ResponseBean getOne(String studentCode){
        return new ResponseBean(HttpStatus.SC_OK,"成功获取学生预警信息",academicAlertService.getAcademicAlertInfo(studentCode));
    }

    @GetMapping("/getclasscompare")
    @LogAnnotation(module = "学业预警模块", operator = "获取对应辅导员的的班级预警情况对比")
    @RequiresAuthentication
    public ResponseBean getClassCompare(String teacherCode){
        return new ResponseBean(HttpStatus.SC_OK,"成功获取学生预警信息",academicAlertService.getAcademicAlertClassCompare(teacherCode));
    }


}
